<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
    <head>
        <%@include file="../common/head.jspf" %>
    </head>

    <body class="fund-page sb-l-o sb-r-c" data-menu="#menu_fund" data-list="#li_fund">

        <!-- 主体内容开始 -->
        <div id="main">

            <!--侧边导航栏-->
            <%@include file="../common/sidebar.jspf" %>

            <!-- Start: Content-Wrapper -->
            <section id="content_wrapper">

                <!-- 顶部导航 -->
                <header id="topbar">
                    <div class="topbar-left">
                        <ol class="breadcrumb">
                            <li class="crumb-active">
                                <span>软擎科技</span>
                            </li>
                            <li class="crumb-icon">
                                <a href="dashboard"><span class="glyphicon glyphicon-home"></span></a>
                            </li>
                            <!-- 当前页 -->
                            <li class="crumb-trail">资金管理</li>
                        </ol>
                    </div>
                    <div class="topbar-right">
                        <!-- 登录信息 -->
                        <%@include file="../common/session.jspf" %>
                    </div>
                </header>
                <!-- 顶部导航结束 -->

                <!-- 页面内容开始 -->
                <section id="content">
                    <div class="btn-group ib mr10">
                        <a href="fund/platform" class="btn btn-primary light">平台资金管理</a>
                        <a href="fund/withdraws/platform" class="btn btn-default light">平台提现审批</a>
                        <a href="fund/withdraws/user" class="btn btn-default light">用户提现审批</a>
                        <a href="fund/transfer" class="btn btn-default light">平台向用户转账审批</a>
                        <a href="fund/operations" class="btn btn-default light">资金操作记录</a>
                        <a href="fund/withdraws/audit/record" class="btn btn-default light">用户提现审批记录</a>
                    </div>
                    <a href="pnr/account" class="btn btn-alert light pull-right" target="_blank"><span class="glyphicons glyphicons-credit_card mr10"></span>登录平台三方账号</a>

                    <hr class="br-light mt10 mb10">

                    <div class="row" id="accountDiv">
                        <div class="text-center pv50 text-muted fs16 mb50"><i class="fa fa-spin fa-spinner mr10"></i>加载平台商户子账号信息 ...</div>
                    </div>

                    <div class="row">
                        <div class="col-md-6">
                            <div class="panel">
                                <div class="panel-heading">
                                    <span class="panel-title">平台充值</span>
                                </div>
                                <div class="panel-body">
                                    <form class="form-horizontal" role="form" action="pnr/deposit" method="post" target="_blank">
                                        <div class="form-group">
                                            <label class="col-lg-3 control-label">充值说明</label>
                                            <div class="col-lg-8">
                                                <p class="form-control-static text-muted">单笔充值金额应大于1元且小于100万元</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="inputStandard" class="col-lg-3 control-label">充值金额</label>
                                            <div class="col-lg-6">
                                                <input type="text" name="amount" class="form-control" placeholder="">
                                            </div>
                                            <div class="col-lg-2 pn">
                                                <button class="btn btn-success btn-block">充值</button>
                                            </div>
                                        </div>
                                    </form> 
                                </div>
                            </div>

                            <div class="panel">
                                <div class="panel-heading">
                                    <ul class="nav panel-tabs panel-tabs-left">
                                        <li class="active">
                                            <a href="#tab3_1" data-toggle="tab">平台普通取现</a>
                                        </li>
                                        <li>
                                            <a href="#tab3_2" data-toggle="tab">平台快捷取现</a>
                                        </li>
                                    </ul>
                                </div>
                                <div class="panel-body">
                                    <div class="tab-content pn br-n">
                                        <div id="tab3_1" class="tab-pane active">
                                            <form class="form-horizontal" role="form" action="pnr/withdraw"  method="post" target="_blank" id="platformWithdrawForm">
                                                <div class="form-group">
                                                    <label class="col-lg-3 control-label">取现说明</label>
                                                    <div class="col-lg-8">
                                                        <p class="form-control-static text-muted">需等待第三方支付审核</p>
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-lg-3 control-label">平台余额</label>
                                                    <div class="col-lg-8">
                                                        <p class="form-control-static text-danger platform-balance"><i class="fa fa-spin fa-spinner text-muted"></i></p>
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label for="inputStandard" class="col-lg-3 control-label">取现金额</label>
                                                    <div class="col-lg-6">
                                                        <input type="text" name="amount" class="form-control" placeholder="">
                                                    </div>
                                                    <div class="col-lg-2 pn">
                                                        <button type="button" class="btn btn-danger btn-block" id="platformWithdrawBtn">普通取现</button>
                                                    </div>
                                                </div>
                                            </form>
                                        </div>
                                        <div id="tab3_2" class="tab-pane">
                                            <form class="form-horizontal" role="form" action="pnr/platformDirectWithdraw" method="post" target="_blank" id="platformDirectWithdrawForm">
                                                <div class="form-group">
                                                    <label class="col-lg-3 control-label">取现说明</label>
                                                    <div class="col-lg-8">
                                                        <p class="form-control-static text-muted">无需审核，直接到账。<code>手续费较贵</code></p>
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-lg-3 control-label">平台余额</label>
                                                    <div class="col-lg-8">
                                                        <p class="form-control-static text-danger platform-balance"><i class="fa fa-spin fa-spinner text-muted"></i></p>
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label for="inputStandard" class="col-lg-3 control-label">取现金额</label>
                                                    <div class="col-lg-6">
                                                        <input type="text" name="amount" class="form-control" placeholder="">
                                                    </div>
                                                    <div class="col-lg-2 pn">
                                                        <button type="button" class="btn btn-alert btn-block" id="platformDirectWithdrawBtn">快捷取现</button>
                                                    </div>
                                                </div>
                                            </form>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="panel">
                                <div class="panel-heading">
                                    <span class="panel-title">平台子账户之间转账</span>
                                </div>
                                <div class="panel-body">
                                    <form class="form-horizontal admin-form" role="form" action="pnr/transfer" method="post" target="_blank" id="transferForm">
                                        <div class="form-group mt20">
                                            <label class="col-lg-3 control-label">转出账户</label>
                                            <div class="col-lg-8">
                                                <label class="field select">
                                                    <select name="outAccount" class="account-select"></select>
                                                    <i class="arrow"></i>
                                                </label>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-lg-3 control-label">转入账户</label>
                                            <div class="col-lg-8">
                                                <label class="field select">
                                                    <select name="inAccount"  class="account-select"></select>
                                                    <i class="arrow"></i>
                                                </label>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="inputStandard" class="col-lg-3 control-label">转账金额</label>
                                            <div class="col-lg-6">
                                                <input type="text" name="amount" class="form-control" placeholder="">
                                            </div>
                                            <div class="col-lg-2 pn">
                                                <button type="button" class="btn btn-success btn-block" id="transferBtn">转账</button>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>

                        <div class="col-md-6">
                            <div class="panel">
                                <div class="panel-heading">
                                    <span class="panel-title">平台向用户转账申请</span>
                                </div>
                                <div class="panel-body">
                                    <form class="form-horizontal" role="form" action="fund/userTransfer" method="post" target="_blank" id="userTransferForm">
                                        <div class="form-group mt15 mb10">
                                            <label for="inputStandard" class="col-lg-3 control-label">转入用户</label>
                                            <div class="col-lg-8 prn">
                                                <input type="text" name="user" class="form-control" placeholder="用户登录名或手机号">
                                                <input type="hidden" name="userId">
                                            </div>
                                        </div>
                                        <div class="form-group mb10">
                                            <label class="col-lg-3 control-label">平台余额</label>
                                            <div class="col-lg-8">
                                                <p class="form-control-static text-danger platform-balance"><i class="fa fa-spin fa-spinner text-muted"></i></p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="inputStandard" class="col-lg-3 control-label">转账金额</label>
                                            <div class="col-lg-6">
                                                <input type="text" name="amount" class="form-control" placeholder="">
                                            </div>
                                            <div class="col-lg-2 pn">
                                                <button type="button" class="btn btn-success btn-block" id="userTransferBtn">申请转账</button>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-lg-3 control-label" for="description">备注</label>
                                            <div class="col-lg-8 prn">
                                                <textarea class="form-control" id="description" name="description"  rows="3"></textarea>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>

                            <!--                            <div class="panel">
                                                            <div class="panel-heading">
                                                                <span class="panel-title">用户取现 <code class="fw400">普通取现，需平台审核，效果同用户前台取现</code></span>
                                                            </div>
                                                            <div class="panel-body">
                                                                <form class="form-horizontal" role="form" action="pnr/userWithdraw" method="post" target="_blank" id="userWithdrawForm">
                                                                    <div class="form-group mt15 mb10">
                                                                        <label for="inputStandard" class="col-lg-3 control-label">取现用户</label>
                                                                        <div class="col-lg-6">
                                                                            <input type="text" name="user" class="form-control" placeholder="取现用户登录名或手机号">
                                                                            <input type="hidden" name="userId">
                                                                        </div>
                                                                        <div class="col-lg-2 pn">
                                                                            <button type="button" class="btn btn-default light btn-block" id="userWithdrawBalanceBtn">查询余额</button>
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-group mb10">
                                                                        <label class="col-lg-3 control-label">用户余额</label>
                                                                        <div class="col-lg-8">
                                                                            <p class="form-control-static text-danger user-balance">0.00</p>
                                                                        </div>
                                                                    </div>
                                                                    <div class="form-group">
                                                                        <label for="inputStandard" class="col-lg-3 control-label">取现金额</label>
                                                                        <div class="col-lg-6">
                                                                            <input type="text" name="amount" class="form-control" placeholder="">
                                                                        </div>
                                                                        <div class="col-lg-2 pn">
                                                                            <button type="button" class="btn btn-danger btn-block" id="userWithdrawBtn">取现</button>
                                                                        </div>
                                                                    </div>
                                                                </form>
                                                            </div>
                                                        </div>-->

                            <div class="panel">
                                <div class="panel-heading">
                                    <span class="panel-title">用户快捷取现 <code class="fw400">无需审核，直接到账，需要额外手续费</code></span>
                                </div>
                                <div class="panel-body">
                                    <form class="form-horizontal" role="form" action="pnr/userDirectWithdraw" method="post" target="_blank" id="userDirectWithdrawForm">
                                        <div class="form-group mt15 mb10">
                                            <label for="inputStandard" class="col-lg-3 control-label">取现用户</label>
                                            <div class="col-lg-6">
                                                <input type="text" name="user" class="form-control" placeholder="取现用户登录名或手机号">
                                                <input type="hidden" name="userId">
                                            </div>
                                            <div class="col-lg-2 pn">
                                                <button type="button" class="btn btn-default light btn-block" id="userDirectWithdrawBalanceBtn">查询余额</button>
                                            </div>
                                        </div>
                                        <div class="form-group mb10">
                                            <label class="col-lg-3 control-label">用户余额</label>
                                            <div class="col-lg-8">
                                                <p class="form-control-static text-danger user-balance">0.00</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label for="inputStandard" class="col-lg-3 control-label">取现金额</label>
                                            <div class="col-lg-6">
                                                <input type="text" name="amount" class="form-control" placeholder="">
                                            </div>
                                            <div class="col-lg-2 pn">
                                                <button type="button" class="btn btn-danger btn-block" id="userDirectWithdrawBtn">取现</button>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </section>
                <!-- 页面内容结束 -->

            </section>
        </div>

        <!-- 主体内容结束 -->
        <script type="text/x-tmpl-mustache" id="accountTemplate">
            <div class="{{cls}}">
            <div class="panel" id="{{id}}">
            <div class="panel-heading">
            <span class="panel-title"><span class="text-muted">{{name}}<code class="fw400">（{{subAcctId}}）</code></span></span>
            </div>
            <div class="panel-body pn">
            <table class="table mbn tc-med-1 tc-bold-last tc-fs13-last">
            <thead>
            <tr class="hidden">
            <th>#</th>
            <th>#</th>
            </tr>
            </thead>
            <tbody>
            <tr>
            <td class="va-m fw600 text-muted">
            <i class="fa fa-circle text-info fs8 pr15"></i>账户余额</td>
            <td class="text-right"><span class="balance">{{acctBal}}</span></td>
            </tr>
            <tr>
            <td class="va-m fw600 text-muted">
            <i class="fa fa-circle text-system fs8 pr15"></i>可用金额</td>
            <td class="text-right"><span class="available">{{avlBal}}</span></td>
            </tr>
            <tr>
            <td class="va-m fw600 text-muted">
            <i class="fa fa-circle text-warning fs8 pr15"></i>冻结金额</td>
            <td class="text-right"><span class="frozen">{{frzBal}}</span></td>
            </tr>
            </tbody>
            </table>
            </div>
            </div>
            </div>
        </script>

        <!-- 公共函数 -->
        <%@include file="../common/scripts.jspf" %>
        <script type="text/javascript" src="${rootPath}/js/pages/fund/platform.js"></script>
    </body>
</html>
